home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-28 | 592 b | 35 lines | [TEXT/KAHL] |
- /*
- * pieces.c - parts stolen from other THINK C libraries
- * Needed because "smart-link" isn't.
- * Naturally, this routines are copyright THINK Technology, Inc
- */
- void setmem(char *p, unsigned n, char c);
- char * strchr(/* char *s, int c */ void);
-
-
- void setmem(p,n,c)
- register char *p;
- register unsigned n;
- register char c;
- {
- while (n--)
- *p++ = c;
- }
-
-
- char *
- strchr(/* char *s, int c */)
- {
- asm {
- movea.l 4(sp),a0 ; A0 = s
- move.w 8(sp),d1 ; D1.B = (char) c
- moveq #0,d0 ; D0.L = result
- bra.s @2
- @1 tst.b (a0)+
- beq.s @3
- @2 cmp.b (a0),d1
- bne.s @1
- move.l a0,d0
- @3 }
- }
-